home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5697 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.2 KB  |  50 lines

  1. Newsgroups: comp.lang.c++
  2. Path: news.dlr.de!news
  3. From: Matthias Sodomann <Matthias.Sodomann@dlr.de>
  4. Subject: Help! How do I reset a ifstream file-pointer to beginning?
  5. X-Nntp-Posting-Host: ws01.sr.kp.dlr.de
  6. Content-Type: text/plain; charset=us-ascii
  7. Message-ID: <311734E8.41C6@dlr.de>
  8. Sender: news@news.dlr.de
  9. Content-Transfer-Encoding: 7bit
  10. Organization: DLR
  11. Mime-Version: 1.0
  12. Date: Tue, 6 Feb 1996 11:00:56 GMT
  13. X-Mailer: Mozilla 2.0b6a (X11; I; AIX 2)
  14.  
  15. Hi there,
  16.  
  17. I have a question concerning ifstream operation. I like to read a file.
  18. It is ASCII. I got me an ifstream in; and opened the file with
  19. in.open("filename",ios::in); So far so good. I read the whole file, and
  20. after this I have to read it again. The reason doesn't matter! How do I
  21. reset the file to start reading from the beginning WITHOUT closing and
  22. reopening it? I tried to use in.seekg(0); or in.seekg(0,ios:beg); but
  23. all this didn't help. What do I have to do? Or is this maybe a matter of
  24. compiler? I work on a IBM RS600 AIX3.2 Workstation with the IBM C++
  25. Compiler xlC.
  26.  
  27.  
  28. I hope, and think, it is an easy problem.
  29.  
  30. ThanX for reading this. Please give me some advice.
  31.  
  32. Matthias
  33. -- 
  34.  
  35. ========================================================================
  36. |  Matthias Sodomann | Phone:                       (+49)2203-601-2928 |
  37. |  DLR               | FAX:                            (+49)2203-68309 |
  38. |  Linder Hoehe 90   | E-mail:                Matthias.Sodomann@dlr.de |
  39. |D-51147 Koeln       | InterNet / WWW:   http://dv.kp.dlr.de/~sodomann |
  40. |  Germany           | anonymous ftp:                    129.247.108.3 |
  41. ========================================================================
  42. |                                                                      |
  43. |                _/_/_/   _/       _/_/_/         //|                  |
  44. |               _/    _/ _/       _/    _/    ___// |___               |
  45. |              _/    _/ _/       _/_/_/_/   //___/  /__//              |
  46. |             _/    _/ _/       _/  _/          || /                   |
  47. |            _/_/_/   _/_/_/_/ _/    _/         ||/                    |
  48. |                                                                      |
  49. ========================================================================
  50.